<?php
	    $lat = $_GET["latitude"];
	    $lon = $_GET["longitude"];
	    if($lat && $lon)
	    {
	    	$html = file_get_contents('http://www.heavens-above.com/allsats.asp?Mag=4.5&lat='.$lat.'&lng='.$lon.'&&alt=0&tz=CET');
	        $pos = strrpos($html,"azimuth");
	        $restOfHTML = "<table BORDER CELLPADDING=5>" . substr($html,$pos+12);
	        $pos = strpos($restOfHTML, "</table>") + 7;
	        $restOfHTML = substr($restOfHTML, 0,$pos);
	        echo '<style type="text/css">body {background-color: #303030;color: #FFFFFF;}</style>';
	        echo $restOfHTML;
	    }
	    else
	    {
	            $html = file_get_contents('http://www.heavens-above.com/allsats.asp?Mag=4.5&lat=00&lng=00&&alt=0&tz=CET');
	            $pos = strrpos($html,"azimuth");
	            $restOfHTML = "<table BORDER CELLPADDING=5>" . substr($html,$pos+12);
	            $pos = strpos($restOfHTML, "</table>") + 7;
	            $restOfHTML = substr($restOfHTML, 0,$pos);
	            echo '<style type="text/css">body {background-color: #303030;color: #FFFFFF;}</style>';
	            echo $restOfHTML;
	    }
?>